function [ret1,ret2]=pop_stack(x)
 if(x.tmpsize<1)
  ret1=eye(2);
  ret2=x;
  return;
 endif
 ele=x.stack{x.tmpsize};
 x.tmpsize=x.tmpsize-1;
 x.mat=x.mat*ele';
 ret1=ele;
 ret2=x;
endfunction
